package com.adams.access.db.bean;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 
 */
@Entity
@Table(name = "T_Menu")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Menu extends EntityObject
{

	/**
	 * 
	 */
	private static final long serialVersionUID = -5298896402988793068L;

	private String menuName; // 菜单名称
	private String menuType; // 菜单类型
	private String menuCode; // 菜单代码
	private String business; // 所属业务
	private String url; // 访问地址

	private Integer ordinal; // 排序
	private Boolean visible; // 是否可见
	private Integer iconId; // 图标编号
	private Long parentId; // 父菜单编号
	private String tips;// 快速提示信息
	private boolean expanded; //菜单是否展开
	
	@Column(length = 64, nullable = false)
	public String getMenuName()
	{
		return menuName;
	}

	public void setMenuName(String menuName)
	{
		this.menuName = menuName;
	}

	@Column(length = 64, nullable = true)
	public String getMenuType()
	{
		return menuType;
	}

	public void setMenuType(String menuType)
	{
		this.menuType = menuType;
	}

	@Column(length = 10, nullable = false)
	public String getMenuCode()
	{
		return menuCode;
	}

	public void setMenuCode(String menuCode)
	{
		this.menuCode = menuCode;
	}

	@Column(length = 64, nullable = false)
	public String getBusiness()
	{
		return business;
	}

	public void setBusiness(String business)
	{
		this.business = business;
	}

	@Column(length = 128, nullable = false)
	public String getUrl()
	{
		return url;
	}

	public void setUrl(String url)
	{
		this.url = url;
	}

	@Column(length = 10, nullable = false)
	public int getOrdinal()
	{
		return ordinal;
	}

	public void setOrdinal(int ordinal)
	{
		this.ordinal = ordinal;
	}

	@Transient
	public boolean isVisible()
	{
		return visible;
	}

	public void setVisible(boolean visible)
	{
		this.visible = visible;
	}

	public Boolean getVisible()
	{
		return visible;
	}

	public void setVisible(Boolean visible)
	{
		this.visible = visible;
	}

	public Integer getIconId()
	{
		return iconId;
	}

	public void setIconId(Integer iconId)
	{
		this.iconId = iconId;
	}

	public Long getParentId()
	{
		return parentId;
	}

	public void setParentId(Long parentId)
	{
		this.parentId = parentId;
	}

	public void setOrdinal(Integer ordinal)
	{
		this.ordinal = ordinal;
	}

	@Column(length = 50)
	public String getTips()
	{
		return tips;
	}

	public void setTips(String tips)
	{
		this.tips = tips;
	}
	
	public boolean isExpanded() {
		return expanded;
	}

	public void setExpanded(boolean expanded) {
		this.expanded = expanded;
	}

}
